# Maintainer: Alexey Pavlov <alexpux@gmail.com>

_realname=curl

pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=7.37.0
pkgrel=1
pkgdesc="An URL retrival utility and library. (mingw-w64)"
arch=('any')
url="http://curl.haxx.se"
license=("MIT")
makedepends=("${MINGW_PACKAGE_PREFIX}-gcc" "${MINGW_PACKAGE_PREFIX}-pkg-config")
depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs"
        "${MINGW_PACKAGE_PREFIX}-gnutls"
        "${MINGW_PACKAGE_PREFIX}-libidn"
        "${MINGW_PACKAGE_PREFIX}-libssh2"
        "${MINGW_PACKAGE_PREFIX}-openssl"
        "${MINGW_PACKAGE_PREFIX}-zlib"
        "${MINGW_PACKAGE_PREFIX}-rtmpdump")
options=('staticlibs' 'strip')
source=("$url/download/${_realname}-$pkgver.tar.bz2"{,.asc})
md5sums=('7dda0cc2e4136f78d5801ac347be696b'
         'SKIP')

prepare() {
  cd "${_realname}-$pkgver"
}

build() {
    mkdir -p "${srcdir}/build-${MINGW_CHOST}"
    cd "${srcdir}/build-${MINGW_CHOST}"
    "${srcdir}"/${_realname}-${pkgver}/configure \
      --prefix=${MINGW_PREFIX} \
      --build=${MINGW_CHOST} \
      --host=${MINGW_CHOST} \
      --target=${MINGW_CHOST} \
      --without-ca-bundle \
      --without-random
    make
}

package() {
  cd "${srcdir}/build-${MINGW_CHOST}"
  make DESTDIR="$pkgdir" install
}
